WOLF core
WOLF: A Modular Estimation Framework for Robotics
XXXXXXXXXXXXXXXXXXXXXXXXvoid(0)" frameborder="0" name="MSearchResults" id="MSearchResults">
wolf::Buffer< T > Class Template Reference

Buffer for arbitrary type objects. More...

#include <core/processor/buffer.h>

Public Types

typedef std::map< TimeStamp, T >::iterator Iterator
 
typedef std::map< TimeStamp, T >::const_iterator ConstIterator
 

Public Member Functions

 Buffer ()
 
 ~Buffer (void)
 
T select (const TimeStamp &_time_stamp, const double &_time_tolerance) const
 Select an element from the buffer. More...
 
ConstIterator selectIterator (const TimeStamp &_time_stamp, const double &_time_tolerance) const
 Select an element iterator from the buffer. More...
 
Iterator selectIterator (const TimeStamp &_time_stamp, const double &_time_tolerance)
 
T selectFirstBefore (const TimeStamp &_time_stamp, const double &_time_tolerance) const
 
T selectLastAfter (const TimeStamp &_time_stamp, const double &_time_tolerance) const
 
T selectFirst () const
 
T selectLast () const
 
SizeStd size (void) const
 Buffer size. More...
 
void emplace (const TimeStamp &_time_stamp, const T &_element)
 Add a element to the buffer. More...
 
const std::map< TimeStamp, T > & getContainer () const
 returns the container with elements of the buffer More...
 
std::map< TimeStamp, T > & getContainer ()
 
void removeUpTo (const TimeStamp &_time_stamp)
 Remove all elements in the buffer with a time stamp older than the specified. More...
 
void removeUpToLower (const TimeStamp &_time_stamp)
 Remove all elements in the buffer with a time stamp older than the specified. More...
 
void clear ()
 Clear the buffer. More...
 
bool empty () const
 is the buffer empty ? More...
 

Static Public Member Functions

static bool checkTimeTolerance (const TimeStamp &_time_stamp1, const TimeStamp &_time_stamp2, const double &_time_tolerance)
 Check time tolerance. More...
 
static bool doubleCheckTimeTolerance (const TimeStamp &_time_stamp1, const double &_time_tolerance1, const TimeStamp &_time_stamp2, const double &_time_tolerance2)
 Check time tolerance. More...
 

Protected Attributes

std::map< TimeStamp, T > container_
 

Detailed Description

template<typename T>
class wolf::Buffer< T >

Buffer for arbitrary type objects.

Object and functions to manage a buffer of objects.

Member Typedef Documentation

◆ ConstIterator

template<typename T >
typedef std::map<TimeStamp,T>::const_iterator wolf::Buffer< T >::ConstIterator

◆ Iterator

template<typename T >
typedef std::map<TimeStamp,T>::iterator wolf::Buffer< T >::Iterator

Constructor & Destructor Documentation

◆ Buffer()

template<typename T >
wolf::Buffer< T >::Buffer ( )
inline

◆ ~Buffer()

template<typename T >
wolf::Buffer< T >::~Buffer ( void  )
inline

Member Function Documentation

◆ checkTimeTolerance()

template<typename T >
bool wolf::Buffer< T >::checkTimeTolerance ( const TimeStamp &  _time_stamp1,
const TimeStamp &  _time_stamp2,
const double &  _time_tolerance 
)
inlinestatic

Check time tolerance.

Check if the time distance between two time stamps is smaller than the time tolerance.

◆ clear()

template<typename T >
void wolf::Buffer< T >::clear
inline

Clear the buffer.

◆ doubleCheckTimeTolerance()

template<typename T >
bool wolf::Buffer< T >::doubleCheckTimeTolerance ( const TimeStamp &  _time_stamp1,
const double &  _time_tolerance1,
const TimeStamp &  _time_stamp2,
const double &  _time_tolerance2 
)
inlinestatic

Check time tolerance.

Check if the time distance between two time stamps is smaller than the minimum time tolerance of the two frames.

◆ emplace()

template<typename T >
void wolf::Buffer< T >::emplace ( const TimeStamp &  _time_stamp,
const T &  _element 
)
inline

Add a element to the buffer.

◆ empty()

template<typename T >
bool wolf::Buffer< T >::empty
inline

is the buffer empty ?

◆ getContainer() [1/2]

template<typename T >
std::map< TimeStamp, T > & wolf::Buffer< T >::getContainer
inline

◆ getContainer() [2/2]

template<typename T >
const std::map< TimeStamp, T > & wolf::Buffer< T >::getContainer
inline

returns the container with elements of the buffer

elements are ordered from most recent to oldest

◆ removeUpTo()

template<typename T >
void wolf::Buffer< T >::removeUpTo ( const TimeStamp &  _time_stamp)
inline

Remove all elements in the buffer with a time stamp older than the specified.

◆ removeUpToLower()

template<typename T >
void wolf::Buffer< T >::removeUpToLower ( const TimeStamp &  _time_stamp)
inline

Remove all elements in the buffer with a time stamp older than the specified.

◆ select()

template<typename T >
T wolf::Buffer< T >::select ( const TimeStamp &  _time_stamp,
const double &  _time_tolerance 
) const
inline

Select an element from the buffer.

Select from the buffer the closest element (w.r.t. time stamp), respecting a defined time tolerances

◆ selectFirst()

template<typename T >
T wolf::Buffer< T >::selectFirst
inline

◆ selectFirstBefore()

template<typename T >
T wolf::Buffer< T >::selectFirstBefore ( const TimeStamp &  _time_stamp,
const double &  _time_tolerance 
) const
inline

◆ selectIterator() [1/2]

template<typename T >
Buffer< T >::Iterator wolf::Buffer< T >::selectIterator ( const TimeStamp &  _time_stamp,
const double &  _time_tolerance 
)
inline

◆ selectIterator() [2/2]

template<typename T >
Buffer< T >::ConstIterator wolf::Buffer< T >::selectIterator ( const TimeStamp &  _time_stamp,
const double &  _time_tolerance 
) const
inline

Select an element iterator from the buffer.

Select from the buffer the iterator pointing to the closest element (w.r.t. time stamp), respecting a defined time tolerances

◆ selectLast()

template<typename T >
T wolf::Buffer< T >::selectLast
inline

◆ selectLastAfter()

template<typename T >
T wolf::Buffer< T >::selectLastAfter ( const TimeStamp &  _time_stamp,
const double &  _time_tolerance 
) const
inline

◆ size()

template<typename T >
SizeStd wolf::Buffer< T >::size ( void  ) const
inline

Buffer size.

Member Data Documentation

◆ container_

template<typename T >
std::map<TimeStamp, T> wolf::Buffer< T >::container_
protected

The documentation for this class was generated from the following file: